import { RouteRecordRaw, createRouter, createWebHistory } from 'vue-router';

import { basicRoutes } from './routes';

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    name: 'Home',
    // eslint-disable-next-line @typescript-eslint/ban-ts-comment
    // @ts-ignore
    // component: () => import('../views/Home.vue'),
    redirect: "/dashboard",
    meta: {
      title: '首页',
    },
  },
];

basicRoutes.forEach(r => {
  routes.push(r as unknown as RouteRecordRaw)
})

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
